package com.jf.identity.controller;

import com.jf.identity.entity.Examinee;
import com.jf.identity.entity.ResponseBean;
import com.jf.identity.service.ExamineeService;
import com.jf.identity.util.Params;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by x on 2018/4/12.
 */
@Controller
@RequestMapping("/cdm/")
public class ExamineeController {

    @Resource
    private ExamineeService examineeService;

    @RequestMapping(value = "set-examinee-sign-info")
    @ResponseBody
    public ResponseBean setExamineeSignInfo(@Validated @RequestBody Examinee examinee,
                                            BindingResult bindingResult) {
        Params.beanValidate(bindingResult);
        return new ResponseBean(examineeService.insertExamineeSignInfo(examinee));
    }

}
